# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: David Ell <david at bytesizebits dot net>

pkgname=linuxdoc-tools
pkgver=0.9.82
pkgrel=2
pkgdesc="Convert LinuxDoc SGML source into other formats"
arch=('loong64' 'x86_64')
url="https://packages.debian.org/sid/linuxdoc-tools"
license=('GPL')
depends=('jade')
makedepends=('texlive-bin' 'texlive-core')
optdepends=('groff' 'texlive-bin')
source=(https://mirrors.edge.kernel.org/debian/pool/main/l/linuxdoc-tools/linuxdoc-tools_${pkgver}.orig.tar.gz)
sha256sums=('65e7c39eeabf464575bf7b5b4c0284ddd2c0e56b3e37e591c861708f1b00013d')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  sed -i '/extern int yyleng;/d' rtf-fix/rtf2rtf.l
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --with-texdir=/usr/share/texmf-dist/tex/linuxdoc
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
}
